<template>
    <div>
        <tours-detail :comment="comment"></tours-detail>
    </div>
</template>

<script>
    import ToursDetail from './component/ToursDetail'
    import axios from 'axios'

    export default {
        name: "TourDetail",
        components: {
            ToursDetail
        },
        data () {
            return{
                comment: []
            }
        },
        mounted() {
            let id = this.$route.params && this.$route.params.id;
            axios.get('/api/tourcomment/index.html').then((response) => {
                let res = response.data.data;
                this.comment = res.filter((res) => {
                    return res.tour_id == id;
                });
                JSON.parse(JSON.stringify(this.comment))
                console.log(this.comment)
            })
        }
    }
</script>

<style scoped>

</style>
